package org.phpsx.amun.newsreader;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

/**
 * Entry
 * 
 * @author     Christoph Kappestein <k42b3.x@gmail.com>
 * @license    http://www.gnu.org/licenses/gpl.html GPLv3
 * @link       http://amun.phpsx.org
 * @category   example
 * @package    newsreader
 * @version    $Revision: 628 $
 */
public class Entry
{
	public static void main(String[] args)
	{
		File config = new File(Newsreader.CONFIG_FILE);

		if(config.isFile())
		{
			try
			{
				Properties prop = new Properties();
				prop.loadFromXML(new FileInputStream(config));

				if(prop.containsKey("token") && prop.containsKey("token_secret"))
				{
					// we have everything start application
					new Newsreader();

					return;
				}
			}
			catch(Exception e)
			{
				System.out.println(e.getMessage());

				e.printStackTrace();
			}
		}

		new Auth();
	}
}
